package com.tuanzi.loan.business.entity.push;

import com.tuanzi.loan.business.constants.push.LoanPushMessageSendTaskStatus;
import com.tuanzi.loan.core.entity.AuditEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Author: chenweijun
 * @Date: 2018/12/12 11:40
 * @Description:消息推送任务
 */
@Data
@Entity
@Table(name = "loan_push_message_send_task")
public class LoanPushMessageSendTask extends AuditEntity {

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotNull
    @Length(max = 50)
    @Column(name = "task_name")
    private String taskName;

    @NotNull
    @Column(name = "message")
    private String message;

    @NotNull
    @Column(name = "push_channel")
    private Integer pushChannel;

    @NotNull
    @Enumerated
    @Column(name = "status")
    private LoanPushMessageSendTaskStatus status;

    @Column(name = "send_time")
    private Date sendTime;

    @Column(name = "finish_time")
    private Date finishTime;

    @Column(name = "send_count")
    private Integer sendCount;

    @Column(name = "arrive_count")
    private Integer arriveCount;

    @Column(name = "open_count")
    private Integer openCount;

    @Column(name = "result")
    private String result;

    @Column(name = "error_reason")
    private String errorReason;

    @Column(name = "product_id")
    private String productId;

    @Column(name = "user_group")
    private Integer userGroup;

}
